#! /bin/bash
dist_path=${WORKSPACE}/dist
project_name=media-admin
nginx_path=/usr/local/nginx/html/$project_name/dist
if [ -d $dist_path ]; then
	echo 'del old dir...'
        rm -rf $dist_path
          fi
if [ -d $nginx_path ]; then
	echo 'del old nginx dir...'
            rm -rf $nginx_path
          fi

/root/develop/node/node-v14.17.5-linux-x64/bin/yarn install
sleep 5s
/root/develop/node/node-v14.17.5-linux-x64/bin/yarn run build
sleep 5s
cp -r ${dist_path} /usr/local/nginx/html/$project_name/